###############################################
# Xenomorph Planetary Infestation Decisions
###############################################

@xenoInfestationCost = 7500
@xenoInfestationTime = 2700
@xenoMegaInfestationCost = 15000
@xenoMegaInfestationTime = 3600
@xenoSpecializationCost = 10000
@xenoSpecializationTime = 3000

decision_xenomorph_tentacle_infestation_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoInfestationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoInfestationCost
		}
	}

	potential = {
		OR = {
			is_planet_class = pc_ocean
			is_planet_class = pc_tropical
			is_planet_class = pc_continental
		}
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_tentacle_infestation_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_tentacle
			swap_districts_effect = {
				DISTRICT1 = district_city
				DISTRICT2 = district_xenomorph_tentacle_neural_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_generator
				DISTRICT2 = district_xenomorph_tentacle_symbiotic_chambers
			}
			swap_districts_effect = {
				DISTRICT1 = district_mining
				DISTRICT2 = district_xenomorph_tentacle_nutrient_pools
			}
			swap_districts_effect = {
				DISTRICT1 = district_farming
				DISTRICT2 = district_xenomorph_tentacle_ovipositor_gardens
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
	}
}

decision_xenomorph_ocean_infestation_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoInfestationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoInfestationCost
		}
	}

	potential = {
		OR = {
			is_planet_class = pc_ocean
		}
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ocean_infestation_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ocean
			swap_districts_effect = {
				DISTRICT1 = district_city
				DISTRICT2 = district_xenomorph_ocean_gene_brine_reefs
			}
			swap_districts_effect = {
				DISTRICT1 = district_generator
				DISTRICT2 = district_xenomorph_ocean_resin_reef_works
			}
			swap_districts_effect = {
				DISTRICT1 = district_mining
				DISTRICT2 = district_xenomorph_ocean_nutrient_tides
			}
			swap_districts_effect = {
				DISTRICT1 = district_farming
				DISTRICT2 = district_xenomorph_ocean_egg_reefs
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
	}
}

decision_xenomorph_ringworld_infestation_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoMegaInfestationTime
	resources = {
		category = decisions
		cost = {
			influence = 150
			alloys = @xenoMegaInfestationCost
		}
	}

	potential = {
		uses_district_set = ring_world
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ringworld_infestation_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ringworld
			swap_districts_effect = {
				DISTRICT1 = district_rw_city
				DISTRICT2 = district_xenomorph_ring_archive_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_nexus
				DISTRICT2 = district_xenomorph_ring_archive_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_hive
				DISTRICT2 = district_xenomorph_ring_archive_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_generator
				DISTRICT2 = district_xenomorph_ring_resin_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_science
				DISTRICT2 = district_xenomorph_ring_archive_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_farming
				DISTRICT2 = district_xenomorph_ring_biomass_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_rw_industrial
				DISTRICT2 = district_xenomorph_ring_resin_segment
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
	}
}

decision_xenomorph_ecumenopolis_infestation_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoMegaInfestationTime
	resources = {
		category = decisions
		cost = {
			influence = 150
			alloys = @xenoMegaInfestationCost
		}
	}

	potential = {
		is_planet_class = pc_city
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ecumenopolis_infestation_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ecumenopolis
			swap_districts_effect = {
				DISTRICT1 = district_arcology_housing
				DISTRICT2 = district_xenomorph_ecu_brood_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_urban_1
				DISTRICT2 = district_xenomorph_ecu_brood_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_urban_2
				DISTRICT2 = district_xenomorph_ecu_brood_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_foundry
				DISTRICT2 = district_xenomorph_ecu_industrial_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_industrial
				DISTRICT2 = district_xenomorph_ecu_industrial_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_administrative
				DISTRICT2 = district_xenomorph_ecu_archive_arcology
			}
			swap_districts_effect = {
				DISTRICT1 = district_arcology_leisure
				DISTRICT2 = district_xenomorph_ecu_brood_arcology
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
	}
}

decision_xenomorph_hive_fortress_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_hive
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_hive_fortress_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_hive_fortress
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_genetic_memory
				DISTRICT2 = district_xenomorph_fortress_memory_vaults
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_resin_production
				DISTRICT2 = district_xenomorph_chitin_ship_spines
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_biomass_feeding
				DISTRICT2 = district_xenomorph_war_beast_feeding_grounds
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_brood_nest
				DISTRICT2 = district_xenomorph_warrior_brood_hatcheries
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_fortress
		}
	}
}

decision_xenomorph_hive_brood_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_hive
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_hive_brood_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_hive_brood
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_genetic_memory
				DISTRICT2 = district_xenomorph_genetic_pleasure_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_resin_production
				DISTRICT2 = district_xenomorph_sensory_resin_chambers
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_biomass_feeding
				DISTRICT2 = district_xenomorph_nutrient_womb_fields
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_brood_nest
				DISTRICT2 = district_xenomorph_grand_ovipositor_fields
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_hive
		}
	}
}

decision_xenomorph_hive_foundry_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_hive
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_hive_foundry_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_hive_foundry
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_genetic_memory
				DISTRICT2 = district_xenomorph_acid_metallurgy_labs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_resin_production
				DISTRICT2 = district_xenomorph_living_alloy_forges
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_biomass_feeding
				DISTRICT2 = district_xenomorph_biomass_fueling_vats
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_brood_nest
				DISTRICT2 = district_xenomorph_forge_brood_incubators
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_foundry
		}
	}
}

decision_xenomorph_tentacle_fortress_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_tentacle
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_tentacle_fortress_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_tentacle_fortress
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_neural_archives
				DISTRICT2 = district_xenomorph_tentacle_war_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_symbiotic_chambers
				DISTRICT2 = district_xenomorph_tentacle_resin_bastions
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_nutrient_pools
				DISTRICT2 = district_xenomorph_tentacle_predatory_pools
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_ovipositor_gardens
				DISTRICT2 = district_xenomorph_tentacle_war_hatcheries
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_fortress
		}
	}
}

decision_xenomorph_tentacle_brood_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_tentacle
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_tentacle_brood_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_tentacle_brood
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_neural_archives
				DISTRICT2 = district_xenomorph_tentacle_sensory_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_symbiotic_chambers
				DISTRICT2 = district_xenomorph_tentacle_pleasure_chambers
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_nutrient_pools
				DISTRICT2 = district_xenomorph_tentacle_brood_gel_pools
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_ovipositor_gardens
				DISTRICT2 = district_xenomorph_tentacle_grand_ovipositors
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_hive
		}
	}
}

decision_xenomorph_tentacle_foundry_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_tentacle
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_tentacle_foundry_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_tentacle_foundry
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_neural_archives
				DISTRICT2 = district_xenomorph_tentacle_industrial_labs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_symbiotic_chambers
				DISTRICT2 = district_xenomorph_tentacle_acid_forges
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_nutrient_pools
				DISTRICT2 = district_xenomorph_tentacle_forge_reservoirs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_tentacle_ovipositor_gardens
				DISTRICT2 = district_xenomorph_tentacle_industrial_pods
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_foundry
		}
	}
}

decision_xenomorph_ringworld_fortress_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ringworld
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ringworld_fortress_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ringworld_fortress
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_archive_segment
				DISTRICT2 = district_xenomorph_ring_war_vaults
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_resin_segment
				DISTRICT2 = district_xenomorph_ring_chitin_shipyards
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_biomass_segment
				DISTRICT2 = district_xenomorph_ring_prey_preserves
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_brood_segment
				DISTRICT2 = district_xenomorph_ring_warrior_hatcheries
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_fortress
		}
	}
}

decision_xenomorph_ringworld_brood_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ringworld
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ringworld_brood_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ringworld_brood
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_archive_segment
				DISTRICT2 = district_xenomorph_ring_continental_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_resin_segment
				DISTRICT2 = district_xenomorph_ring_pleasure_wards
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_biomass_segment
				DISTRICT2 = district_xenomorph_ring_nutrient_terraces
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_brood_segment
				DISTRICT2 = district_xenomorph_ring_ovipositor_network
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_hive
		}
	}
}

decision_xenomorph_ringworld_foundry_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ringworld
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ringworld_foundry_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ringworld_foundry
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_archive_segment
				DISTRICT2 = district_xenomorph_ring_macro_forge_labs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_resin_segment
				DISTRICT2 = district_xenomorph_ring_alloy_foundries
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_biomass_segment
				DISTRICT2 = district_xenomorph_ring_biomass_fuel_segment
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ring_brood_segment
				DISTRICT2 = district_xenomorph_ring_industrial_incubators
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_foundry
		}
	}
}

decision_xenomorph_ecumenopolis_fortress_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ecumenopolis
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ecumenopolis_fortress_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ecumenopolis_fortress
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_archive_arcology
				DISTRICT2 = district_xenomorph_ecu_tactical_memory
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_industrial_arcology
				DISTRICT2 = district_xenomorph_ecu_chitin_bastions
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_biomass_arcology
				DISTRICT2 = district_xenomorph_ecu_sublevel_feeding
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_brood_arcology
				DISTRICT2 = district_xenomorph_ecu_warrior_spawning
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_fortress
		}
	}
}

decision_xenomorph_ecumenopolis_brood_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ecumenopolis
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ecumenopolis_brood_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ecumenopolis_brood
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_archive_arcology
				DISTRICT2 = district_xenomorph_ecu_host_biology_archives
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_industrial_arcology
				DISTRICT2 = district_xenomorph_ecu_pleasure_resin
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_biomass_arcology
				DISTRICT2 = district_xenomorph_ecu_nutrient_processing
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_brood_arcology
				DISTRICT2 = district_xenomorph_ecu_ovipositor_spires
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_hive
		}
	}
}

decision_xenomorph_ecumenopolis_foundry_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ecumenopolis
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ecumenopolis_foundry_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ecumenopolis_foundry
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_archive_arcology
				DISTRICT2 = district_xenomorph_ecu_acid_forge_design
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_industrial_arcology
				DISTRICT2 = district_xenomorph_ecu_living_foundries
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_biomass_arcology
				DISTRICT2 = district_xenomorph_ecu_biomass_furnaces
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ecu_brood_arcology
				DISTRICT2 = district_xenomorph_ecu_forge_drone_spawning
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_foundry
		}
	}
}

decision_xenomorph_ocean_fortress_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ocean
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ocean_fortress_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ocean_fortress
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_gene_brine_reefs
				DISTRICT2 = district_xenomorph_ocean_war_memory_trenches
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_resin_reef_works
				DISTRICT2 = district_xenomorph_ocean_chitin_bastions
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_nutrient_tides
				DISTRICT2 = district_xenomorph_ocean_hunting_grounds
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_egg_reefs
				DISTRICT2 = district_xenomorph_ocean_warrior_egg_reefs
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_fortress
		}
	}
}

decision_xenomorph_ocean_brood_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ocean
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ocean_brood_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ocean_brood
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_gene_brine_reefs
				DISTRICT2 = district_xenomorph_ocean_brood_gene_reefs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_resin_reef_works
				DISTRICT2 = district_xenomorph_ocean_pleasure_lagoons
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_nutrient_tides
				DISTRICT2 = district_xenomorph_ocean_brood_tides
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_egg_reefs
				DISTRICT2 = district_xenomorph_ocean_ovipositor_reefs
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_hive
		}
	}
}

decision_xenomorph_ocean_foundry_project = {
	owned_planets_only = yes
	icon = decision_arcology_project

	enactment_time = @xenoSpecializationTime
	resources = {
		category = decisions
		cost = {
			influence = 100
			alloys = @xenoSpecializationCost
		}
	}

	potential = {
		is_planet_class = pc_xenomorph_infested_ocean
		exists = owner
		owner = {
			any_owned_species = { has_trait = trait_xenomorph }
			has_technology = "tech_hive_cluster"
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = arcology_project_construction_fail_tt
			NOT = { has_planet_flag = arcology_project_construction }
		}
		num_uncleared_blockers < 1

	}

	on_queued = {
		set_planet_flag = arcology_project_construction
	}

	on_unqueued = {
		remove_planet_flag = arcology_project_construction
	}

	effect = {
		remove_planet_flag = arcology_project_construction
		custom_tooltip = decision_xenomorph_ocean_foundry_project_effects
		hidden_effect = {
			change_pc = pc_xenomorph_infested_ocean_foundry
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_gene_brine_reefs
				DISTRICT2 = district_xenomorph_ocean_acid_brine_labs
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_resin_reef_works
				DISTRICT2 = district_xenomorph_ocean_resin_foundries
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_nutrient_tides
				DISTRICT2 = district_xenomorph_ocean_thermal_vents
			}
			swap_districts_effect = {
				DISTRICT1 = district_xenomorph_ocean_egg_reefs
				DISTRICT2 = district_xenomorph_ocean_forge_brood_reefs
			}

			validate_and_repair_planet_buildings_and_districts = yes
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 10
			has_designation = col_foundry
		}
	}
}

